Skip to content

feat(provider/vllm_rerank): add configurable rerank_api_suffix option#7278

Merged
Soulter merged 2 commits intoAstrBotDevs:masterfrom
richard950825-sys:fix/7238-vllm-rerank-suffix
Apr 4, 2026
Merged

feat(provider/vllm_rerank): add configurable rerank_api_suffix option#7278
Soulter merged 2 commits intoAstrBotDevs:masterfrom
richard950825-sys:fix/7238-vllm-rerank-suffix

Conversation

@richard950825-sys
Copy link
Copy Markdown
Contributor

@richard950825-sys richard950825-sys commented Apr 1, 2026

Summary

Add rerank_api_suffix config option to the VLLM Rerank provider so users can control the API URL path suffix instead of having /v1/rerank hardcoded.

Changes:

  • vllm_rerank_source.py: Add rerank_api_suffix config with leading-slash normalization
  • default.py: Add rerank_api_suffix to vLLM Rerank config template and schema
  • config-metadata.json (zh-CN/en-US): Update i18n hints

Behaviour:

  • Default: /v1/rerank — preserves existing behaviour for existing configs
  • Set to empty string to disable auto-append when base_url already contains full path
  • Handles suffix without leading / by auto-adding one

Issue

Fixes #7238

Test Plan

  • Codex CLI review: passed
  • CI: pending

Summary by Sourcery

Make the vLLM rerank provider’s API endpoint path configurable instead of hardcoding the /v1/rerank suffix.

New Features:

  • Add a rerank_api_suffix configuration option to control the path suffix appended to the vLLM rerank API base URL.

Enhancements:

  • Normalize and compose the rerank API URL from base and suffix to support more flexible deployments.

Documentation:

  • Update configuration metadata and i18n hints to describe the new rerank_api_suffix option and its interaction with rerank_api_base.

Add rerank_api_suffix config option to the VLLM Rerank provider so
users can control the API URL path suffix instead of having /v1/rerank
hardcoded.

- Default value is /v1/rerank (preserves existing behavior)
- Users can set it to empty string to disable auto-append
- Handles suffix without leading slash by auto-adding one
- Schema, default config, and i18n metadata all updated

Issue: Fixes AstrBotDevs#7238
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Apr 1, 2026
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@dosubot dosubot bot added the area:provider The bug / feature is about AI Provider, Models, LLM Agent, LLM Agent Runner. label Apr 1, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a configurable rerank_api_suffix for the vLLM rerank provider, allowing users to customize the API endpoint path which was previously hardcoded to /v1/rerank. The changes span configuration defaults, the provider's URL construction logic, and localization files. Review feedback highlights a potential NoneType error when the suffix is explicitly null in the configuration and suggests more generic UI hints for the base URL, as those hints are shared across multiple providers that may not yet support the new suffix field.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 40d2b88413

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

…ptions

- Add explicit None check for rerank_api_suffix (fixes HIGH from Gemini)
- Update rerank_api_base hint to describe actual behavior without
  mentioning specific provider options (fixes 3x MEDIUM from Gemini)
- Add ru-RU i18n for rerank_api_suffix (fixes P2 from Codex)

Co-authored-by: gemini-code-assist[bot]
Co-authored-by: chatgpt-codex-connector[bot]
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Apr 1, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f3575064ee

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Apr 4, 2026
@Soulter Soulter merged commit 70872cd into AstrBotDevs:master Apr 4, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:provider The bug / feature is about AI Provider, Models, LLM Agent, LLM Agent Runner. lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]关于设置是否需要重排序模型接入API URL自动添加后缀/v1/rerank问题

2 participants